#include "YJWidgetFactory.h"


YJWidgetFactory::YJWidgetFactory(int id)
    : YWidgetFactory(){
    	    classId=id;
    	    std::cout << "yjwf constructord  called with id "<< classId << std::endl;
    	    //nothing to do
}

YJDialog * YJWidgetFactory::createDialog
	( YDialogType dialogType, YDialogColorMode colorMode){
	YJDialog * dialog =  new YJDialog(classId, dialogType, colorMode);
	return dialog;
}

YJLabel * YJWidgetFactory::createLabel
	( YWidget * parent, const string & text, bool isHeading, bool isOutputField){
        YJLabel * label =  new YJLabel(classId, parent, text, isHeading, isOutputField);
        return label;
}
    
YJTable * YJWidgetFactory::createTable
        ( YWidget * parent, YTableHeader * header_disown, bool multiSelection){
        YJTable * table = new YJTable(parent, header_disown, multiSelection);
        return table;
}

YJSpacing * YJWidgetFactory::createSpacing
        ( YWidget * parent, YUIDimension dim, bool stretchable, YLayoutSize_t size){
        return new YJSpacing(parent,dim, stretchable, size);
}
    
YJSquash * YJWidgetFactory::createSquash
        ( YWidget * parent, bool horSquash, bool vertSquash ){
        return new YJSquash(parent,horSquash, vertSquash);
}

YJCheckBoxFrame * YJWidgetFactory::createCheckBoxFrame
	( YWidget * parent, const string & label, bool checked ){
        return new YJCheckBoxFrame(parent, label, checked);
}

YJLayoutBox* YJWidgetFactory::createLayoutBox(YWidget* w, YUIDimension dim) {                                                        
        YJLayoutBox * reti = new YJLayoutBox (w, dim);                                                                                 
        return reti;
}                                                                                                                            

YJButtonBox* YJWidgetFactory::createButtonBox( YWidget* w ) {
        YJButtonBox * reti = new YJButtonBox ( w );           
        return reti;
}                                                    

YJPushButton* YJWidgetFactory::createPushButton(YWidget* w, const std::string& label) {
        YJPushButton * reti = new YJPushButton ( w, label );
        return reti;
}                                                                           

YJInputField* YJWidgetFactory::createInputField(YWidget* w, const std::string& label, bool pwdMode) {
        YJInputField * reti = new YJInputField (w, label, pwdMode );                                      
        return reti;
}                                                                                 

YJCheckBox* YJWidgetFactory::createCheckBox(YWidget* w, const std::string& label, bool selected) {
        YJCheckBox * reti = new YJCheckBox (w,label);                                    
        return reti;
}                                                                           

YJRadioButton* YJWidgetFactory::createRadioButton ( YWidget* w, const std::string& label , bool selected) {
        YJRadioButton * reti = new YJRadioButton ( w , label , selected );
        return reti;
                                               
}                                                                                    

YJComboBox* YJWidgetFactory::createComboBox(YWidget* w, const std::string& label, bool writable) {
        YJComboBox * reti = new YJComboBox ( w , label , writable );                                    
        return reti;
}                                                                           


YJSelectionBox* YJWidgetFactory::createSelectionBox(YWidget* w, const std::string& label) {
        YJSelectionBox * reti = new YJSelectionBox ( w , label );                                  
        return reti;
}                                                                                 

YJTree* YJWidgetFactory::createTree(YWidget* w, const std::string& label) {
        YJTree * reti = new YJTree ( w , label );                          
        return reti;
}                                                         

YJProgressBar* YJWidgetFactory::createProgressBar(YWidget* w, const std::string& label, int maxValue) {
        return new YJProgressBar ( w, label, maxValue);
}                                                                                   

YJRichText* YJWidgetFactory::createRichText(YWidget* w, const std::string& label, bool plainTextMode) {
        YJRichText * reti = new YJRichText (w, label, plainTextMode );                                    
        return reti;
}                                                                           

YJBusyIndicator*  YJWidgetFactory::createBusyIndicator(YWidget * parent, const string & label, int timeout) {
        YJBusyIndicator  * reti = new YJBusyIndicator (parent, label, timeout, true);                                        
        return reti;
}                                                                                         

YJIntField* YJWidgetFactory::createIntField(YWidget *parent, const string &label, int minValue, int maxValue, int initValue) {
        YJIntField * reti = new YJIntField (parent, label, minValue, maxValue);                                             
        return reti;
}                                                                                    

YJMenuButton* YJWidgetFactory::createMenuButton(YWidget* parent, const std::string& label) {
        YJMenuButton * reti = new YJMenuButton (parent, label);
        return reti;
}

YJMultiLineEdit* YJWidgetFactory::createMultiLineEdit(YWidget* parent, const std::string& label) {
        YJMultiLineEdit  * reti= new YJMultiLineEdit (parent, label);
        return reti;
}

YJImage* YJWidgetFactory::createImage(YWidget* parent, const string & imageFileName, bool animated){
        YJImage * reti = new YJImage (parent, imageFileName, animated );                                 
        return reti;
}                                                                  

YJLogView* YJWidgetFactory::createLogView(YWidget* parent, const std::string& label, int maxL, int minL) {
        YJLogView  * reti = new YJLogView (parent, label, maxL, minL );                                       
        return reti;
}                                                                            

YJMultiSelectionBox* YJWidgetFactory::createMultiSelectionBox(YWidget* parent, const std::string& label) {
        YJMultiSelectionBox  * reti = new YJMultiSelectionBox (parent, label );
        return reti;
}

YJPackageSelector* YJWidgetFactory::createPackageSelector(YWidget* parent, long int modeFlags) {
        YJPackageSelector * reti = new YJPackageSelector (parent, modeFlags );
        return reti;
}

YJWidget*  YJWidgetFactory::createPkgSpecial(YWidget* parent,  const std::string& label) {
        YJWidget  * reti = new YJWidget (parent); 
        return reti;        
}

YJEmpty* YJWidgetFactory::createEmpty(YWidget* parent) {
        YJEmpty  * reti = new YJEmpty ( parent );
        return reti;
}

YJAlignment*  YJWidgetFactory::createAlignment(YWidget* parent, YAlignmentType horAl, YAlignmentType vertAl) {
        YJAlignment  * reti = new YJAlignment (parent, horAl, vertAl );
        return reti;
}

YJFrame* YJWidgetFactory::createFrame(YWidget* parent, const std::string& label) {
        YJFrame * reti = new YJFrame (parent, label );
        return reti;
}

YJRadioButtonGroup* YJWidgetFactory::createRadioButtonGroup(YWidget* parent) {
        YJRadioButtonGroup * reti = new YJRadioButtonGroup ( parent);
        return reti;
}

YJReplacePoint*  YJWidgetFactory::createReplacePoint(YWidget* parent) {
        YJReplacePoint * reti = new YJReplacePoint (parent );
        return reti;
}


 
